﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DongleTest
{
     class Common
    {

        public class Type
        {
            public const byte Command = 0x01;
            public const byte Event = 0x04;
        }

        public class OpCode
        {
            public const ushort GAP_DeviceInit = 0xFE00;
            public const ushort GAP_GetParam = 0xFE31;
            public const ushort GAP_DeviceDiscoveryRequest = 0xFE04;
            public const ushort GAP_DeviceDiscoveryCancel = 0xFE05;

        }

        public class Event
        {
            public const ushort GAP_HCI_ExtentionCommandStatus = 0x067F;
            public const ushort GAP_DeviceInformation = 0x060D;
            public const ushort GAP_DeviceDiscoveryDone = 0x0601;
            public const ushort GAP_DeviceInitDone = 0x0600;
            public const ushort GAP_EstablishLink = 0x0605;
            public const ushort GAP_TerminateLink = 0x0606;
            public const ushort GAP_LinkParamUpdate = 0x0607;
            public const ushort ATT_FindInfoRsp = 0x0505;
            public const ushort ATT_HandleValueNotification = 0x051B;
            public const ushort ATT_WriteRsp = 0x0513;
            public const ushort HCI_ReadRSSI = 0x0501;
            public const ushort ATT_ReadRsp = 0x050B;
        }

        public class Status
        {
            public const byte Success = 0x00;
            public const byte Completed = 0x1A;
        }
        public class EventCode
        {
            public const ushort Event = 0x00FF;
        }

        public class EventType
        {
            public const byte ConnectableUndirectAdvertisement = 0x00; // 可连接
            public const byte ScanResponse = 0x04;
        }

        public class Format
        {
            public const byte UUID = 0x01; 
            public const byte UUIDs = 0x02;
        }

        public class DiscReason
        {
            public const byte Authentication_Failure = 0x05;
            public const byte Remote_User_Terminated = 0x13;
            public const byte Remote_Device_Low_Resources = 0x14;
            public const byte Remote_Device_Power_Off = 0x15;
            public const byte Unsupported_Remote_Feature = 0x1A;
            public const byte Key_Pairing_Not_Supported = 0x29;
            public const byte Unacceptable_Connection_Interval = 0x3B;
        }
    }
}
